home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / TSMTE.h < prev    next >
Text File  |  1995-07-06  |  5KB  |  172 lines

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __TSMTE__
  21. #define __TSMTE__
  22.  
  23.  
  24. #ifndef __TEXTEDIT__
  25. #include <TextEdit.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Quickdraw.h>                                        */
  30. /*        #include <MixedMode.h>                                    */
  31. /*        #include <QuickdrawText.h>                                */
  32.  
  33. #ifndef __DIALOGS__
  34. #include <Dialogs.h>
  35. #endif
  36. /*    #include <Errors.h>                                            */
  37. /*    #include <Memory.h>                                            */
  38. /*    #include <Menus.h>                                            */
  39. /*    #include <Controls.h>                                        */
  40. /*    #include <Windows.h>                                        */
  41. /*        #include <Events.h>                                        */
  42. /*            #include <OSUtils.h>                                */
  43.  
  44. #ifndef __APPLEEVENTS__
  45. #include <AppleEvents.h>
  46. #endif
  47. /*    #include <EPPC.h>                                            */
  48. /*        #include <AppleTalk.h>                                    */
  49. /*        #include <Files.h>                                        */
  50. /*            #include <Finder.h>                                    */
  51. /*        #include <PPCToolbox.h>                                    */
  52. /*        #include <Processes.h>                                    */
  53. /*    #include <Notification.h>                                    */
  54.  
  55. #ifndef __TEXTSERVICES__
  56. #include <TextServices.h>
  57. #endif
  58. /*    #include <Components.h>                                        */
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63.  
  64. #if PRAGMA_ALIGN_SUPPORTED
  65. #pragma options align=mac68k
  66. #endif
  67.  
  68. #if PRAGMA_IMPORT_SUPPORTED
  69. #pragma import on
  70. #endif
  71.  
  72.  
  73. enum {
  74.     kTSMTESignature                = 'tmTE',
  75.     kTSMTEInterfaceType            = 'tmTE',
  76.     kTSMTEDialog                = 'tmDI'
  77. };
  78.  
  79. /* update flag for TSMTERec*/
  80. enum {
  81.     kTSMTEAutoScroll            = 1
  82. };
  83.  
  84. /* callback procedure definitions*/
  85. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  86. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  87.  
  88. #if GENERATINGCFM
  89. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  90. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  91. #else
  92. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  93. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  94. #endif
  95.  
  96. struct TSMTERec {
  97.     TEHandle                        textH;
  98.     TSMTEPreUpdateUPP                preUpdateProc;
  99.     TSMTEPostUpdateUPP                postUpdateProc;
  100.     long                            updateFlag;
  101.     long                            refCon;
  102. };
  103. typedef struct TSMTERec TSMTERec, *TSMTERecPtr, **TSMTERecHandle;
  104.  
  105. #if ! STRICT_WINDOWS
  106. struct TSMDialogRecord {
  107.     DialogRecord                    fDialog;
  108.     TSMDocumentID                    fDocID;
  109.     TSMTERecHandle                    fTSMTERecH;
  110.     long                            fTSMTERsvd[3];                /* reserved*/
  111. };
  112. typedef struct TSMDialogRecord TSMDialogRecord, *TSMDialogPeek;
  113.  
  114. #endif
  115.  
  116. #if GENERATINGCFM
  117. #else
  118. #endif
  119.  
  120. enum {
  121.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  122.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  123.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  124.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  125.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  126.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  127.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  128.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  129.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  130.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  131.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  132. };
  133.  
  134. #if GENERATINGCFM
  135. #define NewTSMTEPreUpdateProc(userRoutine)        \
  136.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  137. #define NewTSMTEPostUpdateProc(userRoutine)        \
  138.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  139. #else
  140. #define NewTSMTEPreUpdateProc(userRoutine)        \
  141.         ((TSMTEPreUpdateUPP) (userRoutine))
  142. #define NewTSMTEPostUpdateProc(userRoutine)        \
  143.         ((TSMTEPostUpdateUPP) (userRoutine))
  144. #endif
  145.  
  146. #if GENERATINGCFM
  147. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  148.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  149. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  150.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  151. #else
  152. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  153.         (*(userRoutine))((textH), (refCon))
  154. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  155.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  156. #endif
  157.  
  158.  
  159. #if PRAGMA_IMPORT_SUPPORTED
  160. #pragma import off
  161. #endif
  162.  
  163. #if PRAGMA_ALIGN_SUPPORTED
  164. #pragma options align=reset
  165. #endif
  166.  
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170.  
  171. #endif /* __TSMTE__ */
  172.